#include "stdarg.h"
#include "stdio.h"
#include "string.h"

#include "sj_print.h"
#include "device.h"
#include "file_operation.h"


sj_void sj_kprintf(sj_char* fmt,...)
{
    extern struct file *sj_platform_log(sj_void);
    struct file * logdev =sj_platform_log();

    char buf[128]={0};
    va_list ap;
    va_start(ap,fmt);
    vsprintf((char*)buf,fmt,ap);
    va_end(ap);
    if(logdev !=NULL)
    {
        if(logdev->f_op)
        {
            logdev->f_op->write(logdev,buf,strlen(buf),&logdev->f_pos);
        }
    }
}
